import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopDispatchExpressController } from '../../../controllers';
const uctoominishopDispatchExpressRouter = new Router();
const minishopDispatchExpressController = new uctooMinishopDispatchExpressController();

uctoominishopDispatchExpressRouter.post('/add', requireUser, minishopDispatchExpressController.add);
uctoominishopDispatchExpressRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_dispatch_express'), minishopDispatchExpressController.edit);
uctoominishopDispatchExpressRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_dispatch_express'), minishopDispatchExpressController.delete);

//For getting minishopDispatchExpress with permission control
uctoominishopDispatchExpressRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_express'), minishopDispatchExpressController.getSingle);
uctoominishopDispatchExpressRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_express'), minishopDispatchExpressController.getMany);
uctoominishopDispatchExpressRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_dispatch_express'), minishopDispatchExpressController.getMany);

//#endregion AutoCreateCode
export default uctoominishopDispatchExpressRouter;
